#include <iostream>
#include "server/server.h"
#include "server/CUserApi.h"
#include "server/CModelApi.h"
#include "iot_model_device/device_model_mgr/CSysInfoMgr.h"
#include "iot_model_device/device_model_mgr/CModelMgr.h"

int main(int argc, char const *argv[]) {
    //if(!iotplat::CSysInfoMgr::ins().checkSysInit()){
    if (!iotplat::CSysInfoMgr::ins().sysReset()) {
        return -1;
    }

    if(!iotplat::CModelMgr::ins().reloadModels()) {
        return -1;
    }

    if(!iotplat::CModelMgr::ins().reloadDevices()) {
        return -1;
    }

    //}

    iotplat::CModelApi* modelapt = new iotplat::CModelApi;
    iotplat::CUserApi* userapi = new iotplat::CUserApi;

    userapi->start();
    modelapt->start();

    CSimpleAppSingleton::getInstance().port(9999).multithreaded().run();
}
